﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TunnelManager
{
    public static class User
    {
        public static MainForm mainForm { get; set; }
        private static string userid;
        private static string username;
        private static string role;

        public static string Userid
        {
            get
            {
                return userid;
            }

            set
            {
                userid = value;
            }
        }

        public static string Username
        {
            get
            {
                return username;
            }

            set
            {
                username = value;
                mainForm.tbUserName.Text = value;
            }
        }

        public static string Role
        {
            get
            {
                return role;
            }

            set
            {
                role = value;
                switch (value)
                {
                    case "0": mainForm.LoginLevel0(); break;
                    case "1": mainForm.LoginLevel1(); break;
                    case "2": mainForm.LoginLevel2(); break;
                    case "99": mainForm.Logout(); break;
                }
            }
        }
    }
}
